package com.example.springboot2.event.listener;

import com.example.springboot2.event.DemoEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Configuration
@Component
public class EventListenerManage {

    @Async
    @EventListener
    @Order(1)
    public void demoEvent(DemoEvent demoEvent) {
        System.out.println(demoEvent.getMsg());
    }
}
